Attaches a binding to a
System.Windows.FrameworkElement, using the provided binding object, and returns a
System.Windows.Data.BindingExpressionBase for possible later use.
Syntax
| Visual Basic (Declaration) | |
|---|
Public Function SetBinding( _
ByVal dp As System.Windows.DependencyProperty, _
ByVal binding As System.Windows.Data.Binding _
) As System.Windows.Data.BindingExpressionBase |
| C# | |
|---|
public System.Windows.Data.BindingExpressionBase SetBinding(
System.Windows.DependencyProperty dp,
System.Windows.Data.Binding binding
) |
Parameters
- dp
- The dependency property identifier of the property that is data bound.
- binding
- The binding to use for the property.
Return Value
A
System.Windows.Data.BindingExpressionBase object. See Remarks.
Exceptions
| Exception | Description |
| System.ArgumentException | binding is specified as System.Windows.Data.BindingMode.TwoWay, but has an empty System.Windows.Data.Binding.Path.-or-dp or binding parameters are null. |
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also